<?php
include_once(dirname(__FILE__) . "/../../configure/configure.php");		//--> global var
include_once(dirname(__FILE__) . "/../configure/admin.config.inc.php");	//--> admin global var

include_once(dirname(__FILE__) . "/../../lib/impl/CouponImpl.php");

require_once(dirname(__FILE__) . "/../controlHeader.php");					//--> system control header
require_once(dirname(__FILE__) . "/../controlOperate.php");				//-->

$couponImpl	= new CouponImpl(DB_TAG_COUPON);			//--> Coupon


if(isset($_GET['id']) && !empty($_GET['id'])){
	$id = $_GET['id'];

	$isReturn = $couponImpl->delete($id);
	if($isReturn){
		$error_message = 'delete successfully.';
	}else{
		$error_message = 'delete failure.';
	}
}


echo "<script language='javascript'>";
echo "alert(\"$error_message\");";
echo "location.href=\"".$_SERVER['HTTP_REFERER']."\";";
echo "</script>";

//$backurl = $_SERVER['HTTP_REFERER'];
//header("Location: $backurl");
?>
